Discover gists
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
AWSTemplateFormatVersion: '2010-09-09' | |
Description: > | |
SSM Automation Document run a custom SSM Command Document | |
against a fleet of target instances. | |
Parameters: | |
AutomationDocumentName: | |
Type: String | |
Description: Name of created SSM Automation Document | |
Default: MyAutomation |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# To host on root path just use "<Location />" for http://mydomainname.in | |
# To host on non-root path use "<Location /myreactapp>" for http://mydomainname.in/mypath | |
# If non-root path, don't forgot to add "homepage": "/myreactapp" in your app's package.json | |
<VirtualHost *:80> | |
ServerName mydomainname.in | |
DirectoryIndex index.html | |
DocumentRoot /var/www/html | |
ErrorLog ${APACHE_LOG_DIR}/error.log | |
CustomLog ${APACHE_LOG_DIR}/access.log combined |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def dict_dot_notation(d, path=[]): | |
d2 = {} | |
for k, v in d.items(): | |
k_path = path + [str(k)] | |
k_formatted = ".".join(k_path) | |
if isinstance(v, dict): | |
# merge in dict with recursive call | |
d2 = {**d2, **dict_dot_notation(v, path=k_path)} | |
elif isinstance(v, list) or isinstance(v, tuple): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import boto3 | |
import json | |
sechub = boto3.client("securityhub") | |
sts = boto3.client("sts") | |
caller_arn = sts.get_caller_identity()["Arn"] | |
print(caller_arn) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import boto3 | |
import os | |
# Environment variables for configuration | |
role_name = os.environ.get("ROLE_NAME", "OrganizationAccountAccessRole") | |
include_mgmt = os.environ.get("INCLUDE_MGMT", "true").lower() == "true" | |
sts = boto3.client("sts") | |
caller_arn = sts.get_caller_identity()["Arn"] | |
partition = caller_arn.split(":")[1] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM ubuntu:21.10 | |
LABEL maintainer="Taylor Otwell" | |
ARG WWWGROUP | |
WORKDIR /var/www/html | |
ENV DEBIAN_FRONTEND noninteractive | |
ENV TZ=UTC |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# updated 2023-11-27 | |
# updated 2023-10-12 | |
# updated 2021 | |
# updated 2020 | |
# created 2018 | |
import sys | |
import hashlib | |
from urllib.parse import urlparse |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use PhpOffice\PhpSpreadsheet\IOFactory; | |
use PhpOffice\PhpSpreadsheet\Spreadsheet; | |
use PhpOffice\PhpSpreadsheet\Style\Border; | |
use PhpOffice\PhpSpreadsheet\Style\Color; | |
//создать лист и задать отступы | |
$oSpreadsheet = new Spreadsheet(); | |
$sheet = $oSpreadsheet->getActiveSheet(); | |
$sheet->getPageMargins() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
- hosts: localhost | |
connection: local | |
gather_facts: true | |
tasks: | |
- name: Add APT repositories | |
when: ansible_os_family == 'Debian' | |
become: true | |
block: |
NewerOlder